<template>
  <div id="app">
    <h2>测试题</h2>
    <subject
      @status-envent="get($event, item)"
      v-for="item in 5"
      :key="item"
    ></subject>
    <div>
      <flag
        v-for="item in 5"
        :key="item"
        :id="item"
        :status="item === target && status"
      ></flag>
    </div>
  </div>
</template>

<script>
import subject from "../components/math-subject.vue";
import flag from "../components/math-flag.vue";
export default {
  components: {
    subject,
    flag,
  },
  data() {
    return {
      target: 0,
      status: "undo",
    };
  },
  methods: {
    get(value, index) {
      this.status = value;
      this.target = index;
    return { status: "undo", Id: 0 };
    },
  }
}
</script>

<style scoped>
body {
  background-color: #eee;
}

#app {
  background-color: #fff;
  width: 500px;
  margin: 50px auto;
  box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
  padding: 2em;
}
</style>
